package a.f.h.d;

import a.c.e;
import a.c.m;
import a.c.n;
import a.c.q;
import a.c.w;
import a.c.x;
import a.f.h.b.b;
import a.f.h.b.f;
import a.f.o;
import a.i.p;

public class r
  implements b
{
  private static boolean a = false;
  protected q b;
  protected f c;
  protected a.c.k d = new p()
  {
    public boolean getBool(Object paramAnonymousObject)
    {
      return false;
    }
  };
  private int e = 0;
  private int f = 10;
  private int g = 5;
  private int h = 2;
  public static boolean i;
  
  public void a(f paramf)
  {
    this.c = paramf;
    this.b = paramf.a();
  }
  
  public int b()
  {
    return this.e;
  }
  
  public void a(n paramn)
  {
    this.d = paramn;
  }
  
  public void a(int paramInt)
  {
    this.f = paramInt;
  }
  
  public int c()
  {
    return this.f;
  }
  
  public void c(int paramInt)
  {
    this.g = paramInt;
  }
  
  public int d()
  {
    return this.g;
  }
  
  public void e(int paramInt)
  {
    this.h = paramInt;
  }
  
  public int e()
  {
    return this.h;
  }
  
  public void a()
  {
    int k = j.r;
    boolean bool = j.q;
    o localo = (o)this.b;
    x localx = this.b.B();
    n localn1 = this.b.C();
    a(localo, localn1, this.d, localx);
    n localn2 = this.b.C();
    c(localn2);
    int j = 2 * (this.g + this.h);
    n localn3 = localo.C();
    Object localObject = localo.w();
    do
    {
      while (!bool)
      {
        if (!((m)localObject).e()) {
          break;
        }
        localn3.a(((m)localObject).a(), j);
        ((m)localObject).f();
      }
    } while (k != 0);
    localObject = new k();
    ((k)localObject).a(this.c);
    ((k)localObject).a(localx);
    ((k)localObject).c(localn2);
    ((k)localObject).a(localn3);
    ((k)localObject).c(a);
    n localn4 = this.b.C();
    ((k)localObject).b(localn4);
    ((k)localObject).a();
    a(localn4, localn1);
    this.c.m();
    this.b.a(localn4);
    this.b.a(localn1);
    this.b.a(localx);
    this.b.a(localn2);
    this.e = ((k)localObject).b();
    localo.a(localn3);
  }
  
  private void c(n paramn)
  {
    int j = j.r;
    boolean bool = j.q;
    w localw = this.b.v();
    label120:
    do
    {
      do
      {
        if (!localw.e()) {
          return;
        }
        e locale = localw.d();
        if (j != 0) {
          break;
        }
        if (this.c.h(locale))
        {
          m localm = locale.n();
          do
          {
            if (!localm.e()) {
              break label120;
            }
            a.c.d locald = localm.a();
            if (bool) {
              break;
            }
            if (!a(locald.f())) {
              paramn.a(this.c.a(locald), true);
            }
            localm.f();
          } while (!bool);
        }
        localw.f();
      } while (j != 0);
    } while (!bool);
  }
  
  private void a(n paramn1, n paramn2)
  {
    int m = j.r;
    boolean bool = j.q;
    Object localObject = null;
    double d1 = 1.7976931348623157E+308D;
    a.c.d locald1 = this.b.w().a();
    int j = 0;
    label266:
    do
    {
      if (j >= 4) {
        break;
      }
      a.f.h.b.k localk = a.f.h.b.k.a(j);
      this.c.a(paramn1, locald1, localk);
      double d2;
      do
      {
        d2 = 0.0D;
        if (m != 0) {
          return;
        }
        if (bool) {
          break label301;
        }
        m localm = this.b.w();
        do
        {
          if (!localm.e()) {
            break;
          }
          a.c.d locald2 = localm.a();
          if (bool) {
            break label266;
          }
          if ((!this.d.getBool(locald2)) && ((m != 0) || (!this.d.getBool(this.c.a(locald2)))))
          {
            int k = this.c.i(locald2).b(2).h();
            double d3 = k * 3.141592653589793D / 2.0D;
            double d4 = paramn2.getDouble(locald2);
            if ((m != 0) || (!Double.isNaN(d4)))
            {
              double d5 = a.d.d.a(d3, -d4);
              if (m == 0) {
                if (d5 > 3.141592653589793D) {
                  d5 = 6.283185307179586D - d5;
                }
              }
              d2 += d5;
            }
          }
          localm.f();
        } while (!bool);
      } while (m != 0);
      if (d2 < d1)
      {
        d1 = d2;
        localObject = localk;
      }
      j++;
    } while (!bool);
    this.c.a(paramn1, locald1, localObject);
    if (m == 0) {
      label301:
      this.c.o();
    }
  }
  
  private boolean a(e parame)
  {
    int j = j.r;
    if (j == 0) {
      if (!this.c.b(parame)) {
        if (j != 0) {
          break label35;
        }
      }
    }
    label35:
    return this.c.h(parame);
  }
  
  private void a(o paramo, n paramn, a.c.k paramk, x paramx)
  {
    int i1 = j.r;
    boolean bool = j.q;
    double[] arrayOfDouble = new double[paramo.m()];
    a.d.z localz1 = new a.d.z(0.0D, 1.0D);
    Object localObject1 = paramo.w();
    Object localObject2;
    Object localObject3;
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      localObject2 = ((m)localObject1).a();
      if (!paramk.getBool(localObject2))
      {
        localObject3 = new a.d.z(paramo.s((a.c.d)localObject2), paramo.r((a.c.d)localObject2));
        double d1 = a.d.z.d(localz1, (a.d.z)localObject3);
        arrayOfDouble[localObject2.d()] = d1;
        paramn.a(localObject2, d1);
      }
      ((m)localObject1).f();
    } while (!bool);
    localObject1 = paramo.v();
    label232:
    label233:
    label754:
    label756:
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      do
      {
        localObject2 = ((w)localObject1).d();
        localObject3 = new a.c.z();
        int j = 0;
        m localm1 = ((e)localObject2).n();
        do
        {
          if (!localm1.e()) {
            break;
          }
          if (i1 != 0) {
            break label233;
          }
          if (bool) {
            break label232;
          }
          if (!paramk.getBool(localm1.a())) {
            j++;
          }
          localm1.f();
        } while (!bool);
        if (i1 == 0)
        {
          if (j >= 2)
          {
            m localm2 = ((e)localObject2).n();
            u localu;
            a.c.d[] arrayOfd;
            do
            {
              do
              {
                if (!paramk.getBool(localm2.a())) {
                  break;
                }
                localm2.f();
                if (i1 != 0) {
                  break label756;
                }
                if (bool) {
                  break label754;
                }
              } while (!bool);
              localu = new u();
              localu.a(localm2.a());
              arrayOfd = new a.c.d[2];
              arrayOfd[0] = localm2.a();
              localm2.f();
            } while (i1 != 0);
            int m = 0;
            do
            {
              if (m >= ((e)localObject2).e()) {
                break label731;
              }
              arrayOfd[1] = localm2.a();
              localu.a(arrayOfd[1]);
              if (bool) {
                break;
              }
              if (!paramk.getBool(arrayOfd[1]))
              {
                double d2 = a.d.d.a(arrayOfDouble[arrayOfd[1].d()], -arrayOfDouble[arrayOfd[0].d()]);
                if (i1 == 0) {
                  if (d2 == 0.0D)
                  {
                    a.d.z localz2 = new a.d.z(paramo.p(arrayOfd[0]));
                    a.d.z localz3 = new a.d.z(paramo.p(arrayOfd[1]));
                    if (i1 == 0) {
                      if (a.d.z.b(localz2, localz3))
                      {
                        k = -1;
                        if (i1 != 0) {
                          break label542;
                        }
                        if (!bool) {
                          break label521;
                        }
                      }
                    }
                    k = 3;
                    if (i1 != 0) {
                      break label542;
                    }
                    if (!bool) {
                      break label521;
                    }
                  }
                }
                int n = (int)Math.floor(2.0D * d2 / 3.141592653589793D + 0.5D);
                int k = n - 1;
                if (i1 == 0)
                {
                  localu.a(k);
                  if (this.c.h((e)localObject2))
                  {
                    if (i1 == 0) {
                      if (k == 0)
                      {
                        localu.a(new Integer(Math.max(0, 2 * (this.g - this.h))));
                        if (i1 != 0) {
                          break label689;
                        }
                        if (!bool) {
                          break label682;
                        }
                      }
                    }
                    if (i1 == 0)
                    {
                      if (k == 2)
                      {
                        localu.a(new Integer(Math.max(0, 2 * (this.h - this.g))));
                        if (i1 != 0) {
                          break label689;
                        }
                        if (!bool) {
                          break label682;
                        }
                      }
                      localu.a(new Integer(this.f));
                    }
                    if (i1 != 0) {
                      break label689;
                    }
                    if (!bool) {
                      break label682;
                    }
                  }
                }
                localu.a(new Integer(this.f));
                ((a.c.z)localObject3).add(localu);
                localu = new u();
                localu.a(arrayOfd[1]);
                arrayOfd[0] = arrayOfd[1];
              }
              m++;
              localm2.b();
            } while (!bool);
          }
          paramx.a(localObject2, localObject3);
        }
      } while (i1 != 0);
      ((w)localObject1).f();
    } while (!bool);
    label521:
    label542:
    label682:
    label689:
    label731:
    return;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.h.d.r
 * JD-Core Version:    0.7.0.1
 */